<html>
<head>
	<title>Throwing dice</title>
	<script>
	var cwidth = 400;
	var cheigth = 300;
	var dicex = 50;
	var dicey = 50;
	var dicewidth = 100;
	var diceheight = 100;
	var dotrad = 6;
	var ctx;
	var dx =50;
	var dy =50;
	function throwdice(){
		var ch = 1+Math.floor(Math.random()*6);
		dx = dicex;
		dy = dicey;
		drawface(ch);
		dx = dicex + 150;
		dy = dicey + 150;
		ch = 1+Math.floor(Math.random()*6);
		drawface(ch);
	}
	function drawface(){
		ctx = document.getElementById('canvas').getContext('2d');
		ctx.lineWidth = 5;
		//ctx.clearRect(dicex,dicey,dicewidth,diceheight);
		//ctx.strokeRect(dicex,dicey,dicewidth,diceheight);
		ctx.clearRect(dx,dy,dicewidth,diceheight);
		ctx.strokeRect(dx,dy,diceheight,diceheight);
	</script>
</head>	
<body>
<canvas id = "canvas" width = "500" height= "500">
Your brower does'nt support the HTML5 element canvas.
</canvas>
<br />
<button onClick="drawface();">Trow dice</botton>
<form name = "f">
Stage:<input name = "stage" value="First Throw"/>
Point:<input name = "pv" value= " "/>
Outcome:<input name = "outcome" value=" "/>
</form>
</body>
</html>